<%@ page import="gz.gae.blog.ioc.WebBlogUtil" %>
<%@ page import="gz.gae.blog.PreferenceManager" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/jsp/_taglibs.jsp" %>

<%
    PreferenceManager pm = WebBlogUtil.getPrefManager();
    String myPicFId = pm.getPref("myPicture");
    String myMusicFId = pm.getPref("myMusic");
    pm.close();
    pageContext.setAttribute("my_pic_fId", myPicFId);
    pageContext.setAttribute("my_music_fId", myMusicFId);
%>
<style type="text/css">
    .logo {
        border: 1px solid;
        width: 100px;
    }
</style>
<div id="primary" class="widget-area" role="complementary">
    <ul class="xoxo">

        <li id="search-2" class="widget-container widget_search">
            <div>
                <c:if test="${userService.userLoggedIn&&userService.userAdmin}">
                    <form action="admin/add_blog_view.action">
                        <input type="submit" value="发表新文章"/>
                    </form>
                </c:if>
            </div>
        </li>
        <li class="widget-container widget_search">
            <c:if test="${not empty my_pic_fId}">
                <div class="logo"><img src="/file_download?fId=${my_pic_fId}" alt=""></div>
            </c:if>
        </li>

        <li id="archives-2" class="widget-container widget_archive"><h3 class="widget-title">文章归档</h3>
            <ul>
                <c:forEach begin="1" end="12" varStatus="vs">
                    <li>
                        <a href="main.action?month=${vs.index-1}">${vs.index}月</a>
                    </li>
                </c:forEach>
            </ul>
        </li>

        <li id="meta-2" class="widget-container widget_meta"><h3 class="widget-title">功能</h3>
            <ul>
                <li><a href="feed.action?feedType=rss_2.0" title="使用 RSS 2.0 同步站点内容">文章 <abbr
                        title="Really Simple Syndication">RSS</abbr></a></li>

            </ul>

        </li>
    </ul>
</div>